



/**
 * 获取随机干货信息列表 http://gank.io/api/random/data/分类/个数
 * 
 * type: 类别
 * count: 获取条数
 * 
 * @param {*} param0 
 */
export const fetchRandomData = async ({type = '福利', count = 10} = {}) => {
    return fetch(`https://gank.io/api/random/data/${type}/${count}?_t=${(new Date()).getTime()}`,{ mode: "cors"}).then(data=>data.json());
}

/**
 * 分页获取干货信息列表 http://gank.io/api/data/数据类型/请求个数/第几页
 * 
 * type: 类别
 * pageNumber: 当前分码
 * pageSize: 分页大小
 * 
 * @param {*} param0 
 */
export const fetchGankList = async ({type = 'all', pageNumber = 1, pageSize = 10 } = {}) => {
    return fetch(`https://gank.io/api/data/${type}/${pageSize}/${pageNumber}`,{ mode: "cors"}).then(data=>data.json());
}
